<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 日志
 *
 */
class Log extends CI_Controller {
	
	private $tab = 'system';
	function __construct(){
		parent::__construct();
	}
	
	/**
	 * 加载日志信息
	 */
	function load_log_info(){
		$per_page  = intval($this->input->get('per_page')?$this->input->get('per_page'):0);
		$adminname			= $this->input->get('adminname');
		$add_time	= $this->input->get('add_time');
		$data = array();
	    if($adminname!= ''){
			$data['where']['adminname'] = $adminname;
		}
		
		if($add_time != ''){
			$data['where']['add_time'] = $add_time;
		}
		
		
		//---------分页---------
		$data['page_size']  = LOG_LIST_PAGE_SIZE;
		$data['page_start'] = (int)$per_page;
		$data['select'] 	= 1;
		$this->load->model('log_model');
		$vdata = $this->log_model->load_log_info($data);
		
		
		$this->load->library('pagination');
		$config['base_url'] = '/ychadmin/log/load_log_info/?adminname='.$adminname.'&add_time='.$add_time;
		$config['total_rows'] = $vdata['log_count'];
		$config['per_page'] = LOG_LIST_PAGE_SIZE;
		$this->pagination->initialize($config); 
		
		$vdata['tab'] = $this->tab;
		$vdata['sub'] = 'sys_adlog';
		        
		$vdata['adminname'] = $adminname;
		$vdata['add_time'] = $add_time;
		
		$this->load->view('/ychadmin/log_list', $vdata);
	}
	
	/**
	 * 删除日志
	 */
	/*
	function delete_log() {
		$id = $this->input->post ( 'id' );
		$data ["is_del"] = 1;
		$this->load->model ( 'Log_model' );
		echo $this->Log_model->delete_log ( $id, $data );
	}*/
}